#class
# class 类名:                     大驼峰命名法
#     pass
# class Pename:
#     def run(self):
#         print(self)
#         print('跑')
# p1 = Person()
# print(p1)
# # p1.run()
# #
# # p2 =
# class Person:
#     pass
# p1 = Person()
# print(hex(id(p1)))
# print(p1, id(p1))
# p2 = Person()
# print(hex(id(p2)))
# print(p2,id(p2))
# class Person:
#     def eat(self):
#         self.name ='杜金金'
#     def fn1(self):
#         self.name = '尚瑞星'
#     def fn2(self):
#         del self.name
# p1 = Person()
# p1.eat()
# #访问属性
# print(p1.name)
# p1.fn1()
# print(p1.name)
class Cat1:
     def __init__(self,name,age):
        self.name = name
        self.age = age
     def call(self):
         print(f'我的名字是{self.name},我的年龄是:{self.age}')
cat1 = Cat1('大猫', 3)
cat1.call()
cat2 = Cat1('大狗', 2)
cat2.call()


# p1 = Cat1('大狗' ,3)
# print(p1.name)
# print(p1.age)
# p2 = Cat1('二狗', 2)
# print(p2.name)
# print(p2.age)
#
class Cat1:
    def __init__(self, name, age):
        self.name = name
        self.age = age
    def __del__(self):
        print('del触发了')
p1 = Cat1('朱梓鑫', 18)
print(p1.name)
while True:
    print(p1.name)










